package stream;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Stream;

public class Lianxi2 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        Collections.addAll(list, "张无忌", "殷素素", "张三丰", "原神");
        Stream<String> stringStream = list.stream().filter(x -> x.length() == 3);
        System.out.println(stringStream);
//        stringStream.forEach(System.out::println);
        //limit截取
        list.stream().limit(3).forEach(System.out::println);
        //跳过那几个
        list.stream().skip(2).forEach(System.out::println);
    }
}
